home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINWORDS / WINE02BX.ZIP / LISP / MODES / HIDEIF.ELC < prev    next >
Text File  |  1993-03-28  |  17KB  |  188 lines

  1. ;;; compiled by @win386 on Sat Mar 13 14:31:33 1993
  2. ;;; from file c:/src/lucid-19.4/lisp/modes/hideif.el
  3. ;;; emacs version 19.3 Lucid.
  4. ;;; bytecomp version 2.08; 27-aug-92.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs18.
  7.  
  8. (if (and (boundp 'emacs-version)
  9.      (or (and (boundp 'epoch::version) epoch::version)
  10.          (string-lessp emacs-version "19")))
  11.     (error "This file was compiled for Emacs19."))
  12.  
  13. (defvar hide-ifdef-mode-map nil "\
  14. Keymap used with hide-ifdef mode")
  15. (defconst hide-ifdef-mode-prefix-key "" "\
  16. Prefix key for all hide-ifdef-mode commands.")
  17. (defvar hide-ifdef-mode-map-before nil "\
  18. Buffer-local variable to store a copy of the local keymap
  19.     before hide-ifdef-mode modifies it.")
  20. (fset 'define-hide-ifdef-mode-map #[nil "¼τ┴ ┬├─#ê┬┼╞#ê┬╟╚#ê┬╔╩#ê┬╦╠#ê┬═╬#ê┬╧╨#ê┬╤╥#ê┬╙╘#ê┬╒╓#ê┬╫╪#ê┬┘┌#ê┬█▄#ê┬▌▐#ê┬▀α#ê┬ßΓπΣ#σ#ê└Mç" [hide-ifdef-mode-map make-sparse-keymap define-key "d" hide-ifdef-define "u" hide-ifdef-undef "D" hide-ifdef-set-define-alist "U" hide-ifdef-use-define-alist "h" hide-ifdefs "s" show-ifdefs "" hide-ifdef-block "" show-ifdef-block "" forward-ifdef "" backward-ifdef "" down-ifdef "" up-ifdef "" next-ifdef "" previous-ifdef "" hide-ifdef-toggle-read-only where-is-internal toggle-read-only nil t hide-ifdef-toggle-outside-read-only] 6])
  21. (fset 'hif-update-mode-line #[nil "└┴ !ç" [set-buffer-modified-p buffer-modified-p] 2 "\
  22. Update mode-line by setting buffer-modified to itself."])
  23. (defvar hide-ifdef-mode nil "\
  24. non-nil when hide-ifdef-mode is activated.")
  25. (defvar hide-ifdef-hiding nil "\
  26. non-nil when text may be hidden.")
  27. (byte-code "└    ₧¼ä┬    B├    ₧¼ä─    B└ç" [hide-ifdef-hiding minor-mode-alist (hide-ifdef-hiding " Hiding") hide-ifdef-mode (hide-ifdef-mode " Ifdef")] 2)
  28. (fset 'hide-ifdef-mode #[(arg) "└┴!ê\n¼ä    ?¬à├\n!─V┼ ê    ½┌╞╟╚\"ê╞╔╩\"ê╞╦╩\"ê└╠!ê═╠! └╬!ê═╬!└╧!ê└╤!ê╥ ╙╘╥ !!ê╒!ê╫╪\"ê┘ ê┌█!ê½à▌ ê¬â▐ ê▀α!ç½â▐ ê╙!ê▀ß!ç" [make-local-variable hide-ifdef-mode arg prefix-numeric-value 0 hif-update-mode-line modify-syntax-entry 95 "w" 38 "." 124 hide-ifdef-env default-value hide-ifdef-hiding hif-outside-read-only buffer-read-only hide-ifdef-mode-map-before current-local-map use-local-map copy-keymap local-unset-key hide-ifdef-mode-prefix-key local-set-key hide-ifdef-mode-map define-hide-ifdef-mode-map run-hooks hide-ifdef-mode-hook hide-ifdef-initially hide-ifdefs show-ifdefs message "Enter hide-ifdef-mode." "Exit hide-ifdef-mode."] 3 "\
  29. Toggle hide-ifdef-mode.  Thus this is a minor mode, albeit a large one.
  30. With arg, turn hide-ifdef-mode on iff arg is positive.
  31. In hide-ifdef-mode, code within #ifdef constructs that the C preprocessor
  32. would eliminate may be hidden from view.  Several variables affect
  33. how the hiding is done:
  34.  
  35. hide-ifdef-env
  36.     An association list of defined and undefined symbols for the
  37.     current buffer.  Initially, the global value of hide-ifdef-env is used.
  38.  
  39. hide-ifdef-define-alist
  40.     An association list of defined symbol lists.  
  41.         Use hide-ifdef-set-define-alist to save the current hide-ifdef-env
  42.         and hide-ifdef-use-define-alist to set the current hide-ifdef-env
  43.         from one of the lists in hide-ifdef-define-alist.
  44.  
  45. hide-ifdef-lines
  46.     Set to non-nil to not show #if, #ifdef, #ifndef, #else, and
  47.     #endif lines when hiding.
  48.  
  49. hide-ifdef-initially
  50.     Indicates whether hide-ifdefs should be called when hide-ifdef-mode
  51.     is activated.
  52.  
  53. hide-ifdef-read-only
  54.     Set to non-nil if you want to make buffers read only while hiding.
  55.     After show-ifdefs, read-only status is restored to previous value.
  56.  
  57. \\{hide-ifdef-mode-map}" "P"])
  58. (fset 'hif-outline-flag-region #[(from to flag) "└ ┬Ä├ ╟U½â╚¬ü╟╔%*ç" [buffer-modified-p modp ((set-buffer-modified-p modp)) subst-char-in-region from to flag 10 13 t] 6 "\
  59. Hides or shows lines from FROM to TO, according to FLAG.  If FLAG
  60. is \\n (newline character) then text is shown, while if FLAG is \\^M
  61. (control-M) the text is hidden."])
  62. (fset 'hif-show-all #[nil "└ed┴#ç" [hif-outline-flag-region 10] 4 "\
  63. Show all of the text in the current buffer." nil])
  64. (fset 'hide-ifdef-region #[(start end) "└    \n├#ç" [hif-outline-flag-region start end 13] 4 "\
  65. START is the start of a #if or #else form.  END is the ending part.
  66. Everything including these lines is made invisible."])
  67. (fset 'hif-show-ifdef-region #[(start end) "└    \n├#ç" [hif-outline-flag-region start end 10] 4 "\
  68. Everything between START and END is made visible."])
  69. (defvar hide-ifdef-evaluator 'eval "\
  70. The evaluator is given a canonical form and returns T if text under
  71. that form should be displayed.")
  72. (defvar hif-undefined-symbol nil "\
  73. ...is by default considered to be false.")
  74. (defvar hide-ifdef-env nil "\
  75. An alist of defined symbols and their values.")
  76. (fset 'hif-set-var #[(var value) "    B\nBëç" [var value hide-ifdef-env] 2 "\
  77. Prepend (var value) pair to hide-ifdef-env."])
  78. (byte-code "└┴Mê┬├Mê──╞P╚P    ╩P ╠P    ╬ ╬░└ç" [hif-lookup #[(var) "└    \n\"ë½ä A¬ü )ç" [assoc var hide-ifdef-env val hif-undefined-symbol] 4] hif-defined #[(var) "└    !ç" [hif-lookup var] 2] "\\(^\\|\\)[     ]*#[     ]*" hif-cpp-prefix "ifndef" hif-ifndef-regexp "if\\(n?def\\)?[     ]+" hif-ifx-regexp "else" hif-else-regexp "endif" hif-endif-regexp "\\|" hif-ifx-else-endif-regexp] 5)
  79. (fset 'hif-infix-to-prefix #[(token-list) "G┴U½ç┬├@DDç─!ç" [token-list 1 hif-lookup quote hif-parse-if-exp] 3 "\
  80. Convert list of tokens in infix into prefix list"])
  81. (byte-code "└┬─ç" ["^\\(!\\|&&\\|||\\|[()]\\|\\w+\\)" hif-token-regexp "\\*/" hif-end-of-comment nil] 1)
  82. (fset 'hif-tokenize #[(expr-string) "└┴\nG Wâ⌐╞╟\n #½ï┴ò\n S╚Iê¬h╞╔\n #½ó┴ò\n S╚Iê╞\n\n #¼å╞╦\n #ê┴ò\n S╚Iê¬?╞ \n #½╤\n ┴òO┴ò\n S╚Iê╬ÿ½â╧¬▒╨ÿ½â╤¬¿╥ÿ½â╙¬ƒ╘ÿ½â╒¬û╓ÿ½â╫¬ì╪ÿ½â┘¬ä┌!B)é█▄\n\"êéƒ+ç" [nil 0 expr-string expr-length expr-start token-list string-match "^[     ]+" 10 "^/\\*" hif-end-of-comment "$" hif-token-regexp token "||" or "&&" and "!" not "defined" hif-defined "(" lparen ")" rparen intern error "Bad #if expression: %s"] 4 "\
  83. Separate string into a list of tokens"])
  84. (fset 'hif-parse-if-exp #[(token-list) "└ ê┴ \n½à├─\n\"êç" [hif-nexttoken hif-expr token error "Error: unexpected token: %s"] 4 "\
  85. Parse the TOKEN-LIST.  Return translated list in prefix form."])
  86. (fset 'hif-nexttoken #[nil "@A    ç" [token-list token] 1 "\
  87. Pop the next token from token-list into the let variable \"token\"."])
  88. (fset 'hif-expr #[nil "└ \n├=½ï─ ê├    └ E¬p    )ç" [hif-term result token or hif-nexttoken] 3 "\
  89. Parse and expression of the form
  90.        expr : term | expr '||' term."])
  91. (fset 'hif-term #[nil "└ \n├=½ï─ ê├    └ E¬p    )ç" [hif-factor result token and hif-nexttoken] 3 "\
  92. Parse a term of the form
  93.        term : factor | term '&&' factor."])
  94. (fset 'hif-factor #[nil "┴=½ê┬ ê┴├ Dç─=½Ö┬ ê┼ ╟=¼å╚╔\"¬à┬ ê)ç╩=½│┬ ê─=¼ä╚╦!ê┬ ê ═>½à╚╬\"ê┬ ê╟=¼ä╚╧!ê┬ ê╩╨ )DDçë ╤>½ä╚╥!ê┬ ê╙╨ )DDç" [token not hif-nexttoken hif-factor lparen hif-expr result rparen error "Bad token in parenthesized expression: %s" hif-defined "Error: expected \"(\" after \"defined\"" ident (or and not hif-defined lparen rparen) "Error: unexpected token: %s" "Error: expected \")\" after identifier" quote (or and) "Error: missing identifier" hif-lookup] 4 "\
  95. Parse a factor of the form
  96.        factor : '!' factor | '(' expr ')' | 'defined(' id ')' | id."])
  97. (fset 'hif-canonicalize #[nil "è└    !├ !ê`┼╞wê`{╚╔!!\n\n½å╦\nD¬é\n,ç" [looking-at hif-ifndef-regexp negate re-search-forward hif-ifx-regexp "^\n" nil expr-string hif-infix-to-prefix hif-tokenize expr not] 3 "\
  98. When at beginning of #ifX, returns a canonical (evaluatable)
  99.        form for the expression."])
  100. (fset 'hif-find-any-ifX #[nil "└    d┬#├yêç" [re-search-forward hif-ifx-regexp t 0] 4 "\
  101. Position at beginning of next #if, #ifdef, or #ifndef, including one on
  102. this line."])
  103. (fset 'hif-find-next-relevant #[nil "└ê┴\nd├#¡ä─yê└ç" [nil re-search-forward hif-ifx-else-endif-regexp t 0] 4 "\
  104. Position at beginning of next #ifdef, #ifndef, #else, #endif,
  105. NOT including one on this line."])
  106. (fset 'hif-find-previous-relevant #[nil "└yê┴\ne├#¡ä└yê─ç" [0 re-search-backward hif-ifx-else-endif-regexp t nil] 4 "\
  107. Position at beginning of previous #ifdef, #ifndef, #else, #endif,
  108. NOT including one on this line."])
  109. (b